<template>
	<view class="body">
		<xk-header title="我的保养设备"></xk-header>
		<view v-if="deviceList.length > 0" class="list-info" style="padding-top: 20rpx;">
			<view v-for="(item,index) of deviceList" :key="index" class="data-list" >
				<view class="data-item" style="padding-bottom: 20rpx;">
					<view class="order-type">
						<view>{{item.device_code}}-{{item.device_name}}</view>
					</view>
					<view class="order-info" style="margin-bottom: 0;">
						<view class="info-item"><view class="key">设备型号：</view>{{item.device_type}}</view>
						<view class="info-item"><view class="key">设备规格：</view>{{item.device_size}}</view>
						<view class="info-item"><view class="key">安装地点：</view>{{item.address || '-'}}</view>
						<view class="info-item"><view class="key">上次保养日期：</view>{{item.last_patrol_date}}</view>
						<view class="info-item"><view class="key">下次保养日期：</view>{{item.next_patrol_date}}</view>
						<view class="info-item"><view class="key">频次：</view>{{item.patrol_cycle}}天</view>
					</view>
				</view>
			</view>
		</view>
		<view class="empty-view" v-else>
			<image class="empty-icon" :src="(imgUrl+'/wx/empty_data_icon.png')"></image>
			<view>哎呀，该界面暂无内容~</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				imgUrl:this.$config.BASE_imgUrl,
				triggered: false,
				deviceList: [],
			};
		},
		onLoad(){
			this.queryListInfo()
		},
		methods:{
			queryListInfo() {
				this.$api.baseData_getMyDeviceMaintainlScaling().then((res)=>{
					this.deviceList = res
				})
			},
		}
	}
</script>

<style lang="scss" scoped>
.tabs-bar{
	background-color: #FFFFFF;
	display: flex;
	align-items: center;
	// justify-content: space-between;
	padding: 0 30rpx;
	.tabs{
		display: flex;
		align-items: center;
		flex-direction: row;
		justify-content: space-between;
		flex: 1;
		.item{
			display: inline-block;
			height: 65rpx;
			align-items: center;
			justify-content: center;
			font-size: 32rpx;
			color: #333333;
			border-bottom: 6rpx solid rgba(#2C72FF, 0);
		}
		.item-a {
			font-weight: bolder;
			border-bottom: 6rpx solid #2C72FF;
		}

	}
}
.search-area{
	background-color: #FFFFFF;
	padding: 20rpx 30rpx;
	.search-input{
		height: 80rpx;
		background: #F8F8F8;
		border-radius: 10rpx;
		display: flex;
		flex: 1;
		align-items: center;
		.search-icon{
			width: 48rpx;
			height: 48rpx;
			margin: 0 20rpx 0 30rpx;
		}
		input{
			height: 80rpx;
			font-size: 28rpx;
			flex: 1;
		}
	}
}
.picker-bar{
	height: 88rpx;
	display: flex;
	align-items: center;
	padding: 0 30rpx;
	background-color: #F8F8F8;
	.picker-item{
		font-size: 28rpx;
		font-weight: bolder;
		color: #333333;
		display: flex;
		align-items: center;
		margin-right: 100rpx;
		image{
			width: 24rpx;
			height: 24rpx;
			margin-left: 20rpx;
		}
	}
}
.list-info {
	margin: 0 30rpx;
	padding-bottom: 30rpx;
	.list-swiper{
		height: 1000rpx;
	}
	.data-list{
		background-color: #FFFFFF;
		border-radius: 10rpx;
		padding: 30rpx 20rpx 0;
		margin-bottom: 20rpx;
		.data-item{
			// display: flex;
			// margin-bottom: 30rpx;
			.order-type{
				display: flex;
				justify-content: space-between;
				align-items: center;
				font-size: 28rpx;
				color: #333333;
				text{
					font-weight: bolder;
				}
				.type{
					font-size: 24rpx;
					font-weight: bolder;
					padding: 12rpx;
					border-radius: 4rpx;
				}
				.red{
					color: #FF3737;
					background-color: #FFEFEF;
				}
				.yellow{
					color: #FF972C;
					background-color: #FFF8EF;
				}
				.blue{
					color: #2C72FF;
					background-color: rgba($color: #A5C2FF, $alpha: .16);
				}
			}
			.order-info{
				margin: 20rpx 0;
				.info-item{
					display: flex;
					font-size: 28rpx;
					color: #333333;
					line-height: 50rpx;
					.key{
						min-width: 150rpx;
						font-size: 28rpx;
						color: #999999;
					}
					.info-imgs{
						display: flex;
						flex-wrap: wrap;
						.img-item{
							width: 120rpx;
							height: 120rpx;
							margin: 2rpx 2rpx 0 0;
						}
					}
				}
				.error{
					color: #FF3737;
				}
			}
			.handle-btn{
				border-top: 1px solid #F5F5F5;
				height: 95rpx;
				margin-top: 20rpx;
				display: flex;
				> view{
					height: 95rpx;
					display: flex;
					justify-content: center;
					align-items: center;
					font-size: 32rpx;
					font-weight: bolder;
					color: #333333;
					flex: 1;
				}
				& :last-child{
					color: #0055FE;
				}
			}
			.target-info{
				flex: 1;
				display: flex;
				padding-bottom: 20rpx;
				.img{
					width: 260rpx;
					height: 195rpx;
					border-radius: 10rpx;
					margin-right: 20rpx;
				}
				.top{
					.name{
						font-size: 28rpx;
						font-weight: bolder;
						color: #333333;
					}
					.desc{
						font-size: 28rpx;
						color: #999999;
						margin-top: 10rpx;
					}
				}
				.fee{
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin-top: 30rpx;
					.amount{
						font-size: 36rpx;
						color: #FF3737;
					}
				}
			}
		}
	}
}
</style>
